import 'package:flutter/material.dart';

class FlightText extends StatefulWidget {
  final double startSize;
  final double endSize;

  const FlightText({Key key, this.startSize = 20, this.endSize = 40})
      : super(key: key);

  @override
  _FlightTextState createState() => _FlightTextState();
}

class _FlightTextState extends State<FlightText>
    with SingleTickerProviderStateMixin {
  AnimationController _animationController;
  Animation<double> _fontSizeTween;
  double fontSize;

  @override
  void initState() {
    super.initState();

    _animationController =
        AnimationController(duration: Duration(milliseconds: 3330), vsync: this)
          ..addListener(() {
            setState(() {
              fontSize = _fontSizeTween.value;
            });
          });

    _fontSizeTween = Tween<double>(
      begin: widget.startSize,
      end: widget.endSize,
    ).animate(
      CurvedAnimation(
        parent: _animationController,
        curve: Curves.linear,
      ),
    );

    _animationController.forward();
  }

  @override
  Widget build(BuildContext context) {
    return Text(
          'Neaches',
          maxLines: 1,
          overflow: TextOverflow.visible,
          style: TextStyle(
              fontSize: fontSize,
              color: Colors.black,
              fontWeight: FontWeight.normal),
        );
  }
}
